<template>
  <div class="profile_page">
    <div class="head">
      <div class="user">
        <div class="top">
          <div class="left" @click="goBack"><i class="el-icon-arrow-left" style="z-index:10"></i></div>
        </div>
        <div class="info">
          <img :src="userInfo.headimgurl" alt="" style="z-index:10">
          <span class="name" style="z-index:10">{{userInfo.nickname}}</span>
        </div>
        <img :src="userInfo.headimgurl" alt="" class="top-cover user">
      </div>
      <!--<div class="content">-->
      <!--<div class="money">-->
      <!--<div class="">0元</div>-->
      <!--<span>余额 | 充值</span>-->
      <!--</div>-->
      <!--<div class="ording">-->
      <!--<div><i class="el-icon-sold-out"></i></div>-->
      <!--<span>我的订单</span>-->
      <!--</div>-->
      <!--<div class="card">-->
      <!--<div><i class="el-icon-document"></i></div>-->
      <!--<span>我的优惠券</span>-->
      <!--</div>-->
      <!--</div>-->
    </div>
    <div class="body">
      <!--<div class="spacing"></div>-->
      <div class="option">
        <!--<div class="o-item">-->
        <!--<div>-->
        <!--<i class="el-icon-bell"></i>-->
        <!--<span>完善个人信息</span>-->
        <!--</div>-->
        <!--<i class="el-icon-arrow-right"></i></div>-->
        <div class="o-item" @click="goPage('order')">
          <div>
            <i class="el-icon-bell"></i>
            <span>我的订单</span>
          </div>
          <i class="el-icon-arrow-right"></i>
        </div>
        <!--<div class="o-item" @click="showAdress">-->
          <!--<div>-->
            <!--<i class="el-icon-bell"></i>-->
            <!--<span>收货地址管理</span>-->
          <!--</div>-->
          <!--<i class="el-icon-arrow-right"></i>-->
        <!--</div>-->
      </div>
      <div class="spacing"></div>
      <!--<div class="option">-->
      <!--<div class="o-item" @click="goPage('help')">-->
      <!--<div>-->
      <!--<i class="el-icon-bell"></i>-->
      <!--<span>帮助中心</span>-->
      <!--</div>-->
      <!--<i class="el-icon-arrow-right"></i>-->
      <!--</div>-->
      <!--</div>-->
    </div>
    <v-address ref="address"></v-address>
  </div>
</template>

<script>
  import {_post} from '../../api/mainApi';
  import Address from 'components/Address/Address';

  export default {
    name: 'Mine',
    data() {
      return {
        userInfo: {}
      };
    },
    components: {
      'v-address': Address
    },
    mounted() {
      this.initData();
    },
    created() {
      this.getMyinfo();
    },
    methods: {
      goBack() {
        this.$router.go(-1);
      },
      initData() {

      },
      showAdress() {
        this.$refs.address.initShow();
      },
      goPage(path) {
        this.$router.push(path);
      },
      getMyinfo() {
        _post('frontend/member/detail', {}).then(res => {
          let data = res.data;
          console.log('userinfo', data);
          if (data.code === 200) {
            this.userInfo = data.data;
          }
        });
      }

    }
  };
</script>

<style lang="scss" scoped>
  .top-cover{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-size: 100%;
    -webkit-filter: blur(2px); /* Chrome, Safari, Opera */
    filter: blur(5px);
    opacity:0.6
  }
  .head {
    position: relative;
    display: flex;
    flex-flow: column;
    .user {
      height: 195px;
      background: #ebeff3;
      .top {
        height: 45px;
        padding-top: 30px;
        .left {
          display: flex;
          justify-content: center;
          align-items: center;
          height: 30px;
          width: 30px;
          border-radius: 50%;
          background: #93999f;
          font-size: 24px;
          color: #ffffff;
          margin-left: 20px;
        }
      }
      .info {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        .name {
          margin-left: 20px;
        }
        img {
          width: 100px;
          height: 100px;
          margin-left: 45px;
          border-radius: 50%;
        }
      }

    }
    .content {
      display: flex;
      justify-content: space-between;
      height: 125px;
      > div {
        display: flex;
        flex-flow: column;
        justify-content: space-around;
        align-items: center;
        height: 80px;
        flex: 1;
      }
    }

  }

  .spacing {
    height: 12px;
    width: 100%;
    background: #f5f5f5;
  }

  .option {
    display: flex;
    flex-flow: column;
    padding: 0 20px;
    .o-item {
      height: 60px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid #eee;
      color: #2b333b;
      font-size: 15px;
      span {
        margin-left: 10px;
      }
    }
  }

</style>
